package com.navi.loaddata.core.gpEntity;

import com.alibaba.fastjson.annotation.JSONField;
import com.navi.loaddata.core.entity.BaseEntity;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "wpp_fsht_ope_his", schema = "sor", catalog = "qmstst")
@IdClass(WppFshtOpeHisPK.class)
public class WppFshtOpeHis extends BaseEntity implements Serializable{
    private String glassId;
    private Integer prodKeyFk;
    private String prodId;
    private String owner;
    private String lotId;
    private String grade;
    private String opeId;
    private Integer opeKeyFk;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp logonTimestamp;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp logofTimestamp;
    private String evtUser;
    private String eqptId;
    private String unitEq;
    private String recipeId;
    private Integer position;
    private String productSpecversion;
    private String carrierName;
    private Integer reworkCount;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp etlTimestamp;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp mesTimestamp;
    private String etlEventNode;
    private String etlEventName;
    private Date caldDate;
    private String shfId;
    private Integer hourKeyFk;

    @Id
    @Column(name = "glass_id")
    public String getGlassId() {
        return glassId;
    }

    public void setGlassId(String glassId) {
        this.glassId = glassId;
    }

    @Basic
    @Column(name = "prod_key_fk")
    public Integer getProdKeyFk() {
        return prodKeyFk;
    }

    public void setProdKeyFk(Integer prodKeyFk) {
        this.prodKeyFk = prodKeyFk;
    }

    @Basic
    @Column(name = "mes_timestamp")
    public Timestamp getMesTimestamp() {
        return mesTimestamp;
    }

    public void setMesTimestamp(Timestamp mesTimestamp) {
        this.mesTimestamp = mesTimestamp;
    }
    @Basic
    @Column(name = "prod_id")
    public String getProdId() {
        return prodId;
    }

    public void setProdId(String prodId) {
        this.prodId = prodId;
    }

    @Basic
    @Column(name = "owner")
    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    @Basic
    @Column(name = "lot_id")
    public String getLotId() {
        return lotId;
    }

    public void setLotId(String lotId) {
        this.lotId = lotId;
    }

    @Basic
    @Column(name = "grade")
    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    @Id
    @Column(name = "ope_id")
    public String getOpeId() {
        return opeId;
    }

    public void setOpeId(String opeId) {
        this.opeId = opeId;
    }

    @Basic
    @Column(name = "ope_key_fk")
    public Integer getOpeKeyFk() {
        return opeKeyFk;
    }

    public void setOpeKeyFk(Integer opeKeyFk) {
        this.opeKeyFk = opeKeyFk;
    }

    @Basic
    @Column(name = "logon_timestamp")
    public Timestamp getLogonTimestamp() {
        return logonTimestamp;
    }

    public void setLogonTimestamp(Timestamp logonTimestamp) {
        this.logonTimestamp = logonTimestamp;
    }

    @Id
    @Column(name = "logof_timestamp")
    public Timestamp getLogofTimestamp() {
        return logofTimestamp;
    }

    public void setLogofTimestamp(Timestamp logofTimestamp) {
        this.logofTimestamp = logofTimestamp;
    }

    @Basic
    @Column(name = "evt_user")
    public String getEvtUser() {
        return evtUser;
    }

    public void setEvtUser(String evtUser) {
        this.evtUser = evtUser;
    }

    @Basic
    @Column(name = "eqpt_id")
    public String getEqptId() {
        return eqptId;
    }

    public void setEqptId(String eqptId) {
        this.eqptId = eqptId;
    }

    @Basic
    @Column(name = "unit_eq")
    public String getUnitEq() {
        return unitEq;
    }

    public void setUnitEq(String unitEq) {
        this.unitEq = unitEq;
    }

    @Basic
    @Column(name = "recipe_id")
    public String getRecipeId() {
        return recipeId;
    }

    public void setRecipeId(String recipeId) {
        this.recipeId = recipeId;
    }

    @Basic
    @Column(name = "position")
    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    @Basic
    @Column(name = "product_specversion")
    public String getProductSpecversion() {
        return productSpecversion;
    }

    public void setProductSpecversion(String productSpecversion) {
        this.productSpecversion = productSpecversion;
    }

    @Basic
    @Column(name = "carrier_name")
    public String getCarrierName() {
        return carrierName;
    }

    public void setCarrierName(String carrierName) {
        this.carrierName = carrierName;
    }

    @Basic
    @Column(name = "rework_count")
    public Integer getReworkCount() {
        return reworkCount;
    }

    public void setReworkCount(Integer reworkCount) {
        this.reworkCount = reworkCount;
    }

    @Basic
    @Column(name = "etl_timestamp")
    public Timestamp getEtlTimestamp() {
        return etlTimestamp;
    }

    public void setEtlTimestamp(Timestamp etlTimestamp) {
        this.etlTimestamp = etlTimestamp;
    }

    @Basic
    @Column(name = "etl_event_node")
    public String getEtlEventNode() {
        return etlEventNode;
    }

    public void setEtlEventNode(String etlEventNode) {
        this.etlEventNode = etlEventNode;
    }

    @Basic
    @Column(name = "etl_event_name")
    public String getEtlEventName() {
        return etlEventName;
    }

    public void setEtlEventName(String etlEventName) {
        this.etlEventName = etlEventName;
    }

    @Basic
    @Column(name = "cald_date")
    @JSONField(format = "yyyy-MM-dd")
    public Date getCaldDate() {
        return caldDate;
    }

    public void setCaldDate(Date caldDate) {
        this.caldDate = caldDate;
    }

    @Basic
    @Column(name = "shf_id")
    public String getShfId() {
        return shfId;
    }

    public void setShfId(String shfId) {
        this.shfId = shfId;
    }

    @Basic
    @Column(name = "hour_key_fk")
    public Integer getHourKeyFk() {
        return hourKeyFk;
    }

    public void setHourKeyFk(Integer hourKeyFk) {
        this.hourKeyFk = hourKeyFk;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof WppFshtOpeHis)) return false;

        WppFshtOpeHis that = (WppFshtOpeHis) o;

        if (glassId != null ? !glassId.equals(that.glassId) : that.glassId != null) return false;
        if (prodKeyFk != null ? !prodKeyFk.equals(that.prodKeyFk) : that.prodKeyFk != null) return false;
        if (prodId != null ? !prodId.equals(that.prodId) : that.prodId != null) return false;
        if (owner != null ? !owner.equals(that.owner) : that.owner != null) return false;
        if (lotId != null ? !lotId.equals(that.lotId) : that.lotId != null) return false;
        if (grade != null ? !grade.equals(that.grade) : that.grade != null) return false;
        if (opeId != null ? !opeId.equals(that.opeId) : that.opeId != null) return false;
        if (opeKeyFk != null ? !opeKeyFk.equals(that.opeKeyFk) : that.opeKeyFk != null) return false;
        if (logonTimestamp != null ? !logonTimestamp.equals(that.logonTimestamp) : that.logonTimestamp != null)
            return false;
        if (logofTimestamp != null ? !logofTimestamp.equals(that.logofTimestamp) : that.logofTimestamp != null)
            return false;
        if (evtUser != null ? !evtUser.equals(that.evtUser) : that.evtUser != null) return false;
        if (eqptId != null ? !eqptId.equals(that.eqptId) : that.eqptId != null) return false;
        if (unitEq != null ? !unitEq.equals(that.unitEq) : that.unitEq != null) return false;
        if (recipeId != null ? !recipeId.equals(that.recipeId) : that.recipeId != null) return false;
        if (position != null ? !position.equals(that.position) : that.position != null) return false;
        if (productSpecversion != null ? !productSpecversion.equals(that.productSpecversion) : that.productSpecversion != null)
            return false;
        if (carrierName != null ? !carrierName.equals(that.carrierName) : that.carrierName != null) return false;
        if (reworkCount != null ? !reworkCount.equals(that.reworkCount) : that.reworkCount != null) return false;
        if (etlTimestamp != null ? !etlTimestamp.equals(that.etlTimestamp) : that.etlTimestamp != null) return false;
        if (mesTimestamp != null ? !mesTimestamp.equals(that.mesTimestamp) : that.mesTimestamp != null) return false;
        if (etlEventNode != null ? !etlEventNode.equals(that.etlEventNode) : that.etlEventNode != null) return false;
        if (etlEventName != null ? !etlEventName.equals(that.etlEventName) : that.etlEventName != null) return false;
        if (caldDate != null ? !caldDate.equals(that.caldDate) : that.caldDate != null) return false;
        if (shfId != null ? !shfId.equals(that.shfId) : that.shfId != null) return false;
        return hourKeyFk != null ? hourKeyFk.equals(that.hourKeyFk) : that.hourKeyFk == null;
    }

    @Override
    public int hashCode() {
        int result = glassId != null ? glassId.hashCode() : 0;
        result = 31 * result + (prodKeyFk != null ? prodKeyFk.hashCode() : 0);
        result = 31 * result + (prodId != null ? prodId.hashCode() : 0);
        result = 31 * result + (owner != null ? owner.hashCode() : 0);
        result = 31 * result + (lotId != null ? lotId.hashCode() : 0);
        result = 31 * result + (grade != null ? grade.hashCode() : 0);
        result = 31 * result + (opeId != null ? opeId.hashCode() : 0);
        result = 31 * result + (opeKeyFk != null ? opeKeyFk.hashCode() : 0);
        result = 31 * result + (logonTimestamp != null ? logonTimestamp.hashCode() : 0);
        result = 31 * result + (logofTimestamp != null ? logofTimestamp.hashCode() : 0);
        result = 31 * result + (evtUser != null ? evtUser.hashCode() : 0);
        result = 31 * result + (eqptId != null ? eqptId.hashCode() : 0);
        result = 31 * result + (unitEq != null ? unitEq.hashCode() : 0);
        result = 31 * result + (recipeId != null ? recipeId.hashCode() : 0);
        result = 31 * result + (position != null ? position.hashCode() : 0);
        result = 31 * result + (productSpecversion != null ? productSpecversion.hashCode() : 0);
        result = 31 * result + (carrierName != null ? carrierName.hashCode() : 0);
        result = 31 * result + (reworkCount != null ? reworkCount.hashCode() : 0);
        result = 31 * result + (etlTimestamp != null ? etlTimestamp.hashCode() : 0);
        result = 31 * result + (mesTimestamp != null ? mesTimestamp.hashCode() : 0);
        result = 31 * result + (etlEventNode != null ? etlEventNode.hashCode() : 0);
        result = 31 * result + (etlEventName != null ? etlEventName.hashCode() : 0);
        result = 31 * result + (caldDate != null ? caldDate.hashCode() : 0);
        result = 31 * result + (shfId != null ? shfId.hashCode() : 0);
        result = 31 * result + (hourKeyFk != null ? hourKeyFk.hashCode() : 0);
        return result;
    }
}
